package com.he.hsdyc.common.constant;

import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * @Author :
 * @Description :
 * @Date : Created in 16:20 2017/11/24
 */
@ConfigurationProperties(prefix = "management")
public class ServerProperties {

    private String oUser;

    public final String getoUser() {
        return oUser;
    }

    public void setoUser(String oUser) {
        this.oUser = oUser;
    }



    //添加properties配置常量
   /* 1》pom中添加spring-boot-configuration-processor
    2》application.yml中添加要配置的常量
                   management:
                        oUser: oauth-cache-user-management
    3》添加常量配置类ServerProperties
        声明属性 get/set/
        注解@ConfigurationProperties(prefix = "management")

    4》主类中添加注解@EnableConfigurationProperties(ServerProperties.class)

    5》在需要引用常量类中@Autowired   ServerProperties  然后直接引用类中属性

    @Value("${management.oUser}")注解属性可以直接使用，但属性较多时比较麻烦*/



}
